<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html lang="en">

<head>
    <!-- 指定字符集 -->
    <meta charset="utf-8">
    <!-- 使用Edge最新的浏览器的渲染方式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- viewport视口：网页可以根据设置的宽度自动进行适配，在浏览器的内部虚拟一个容器，容器的宽度与设备的宽度相同。
    width: 默认宽度与设备的宽度相同
    initial-scale: 初始的缩放比，为1:1 -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>提交订单</title>
    <!-- 1. 导入CSS的全局样式 -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- 2. jQuery导入，建议使用1.9以上的版本 -->
    <script src="js/jquery-2.1.0.min.js"></script>
    <!-- 3. 导入bootstrap的js文件 -->
    <script src="js/bootstrap.min.js"></script>
    <!-- 导入自己的css -->
    <link rel="stylesheet" type="text/css" href="css/shop.css"/>

    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .one li a {
            text-decoration: none;
            color: red;

        }

        li {
            list-style: none;
        }


        .one li {
            list-style: none;
            float: left;
            font-size: 10px;
            margin-right: 10px;

        }

        /* ul {
            margin: auto 0;
            margin-left: 50%;
        } */

        .header {
            width: 1000px;
            height: 20px;
        }

        .two ul li {
            list-style: none;
            float: left;


        }

        .two ul li img {
            margin-left: 10px;

        }

        .two {
            text-align: left;
            float: left;
            margin-left: 150px;

        }

        .three {
            float: left;
        }

        .three ul {
            margin: auto 0;
        }

        .three ul li {
            text-align: center;
            float: left;
            margin-left: 50px;

        }

        .three ul li a {
            color: white;
            text-decoration: none;
        }

        * {
            margin: 0 auto;
            padding: 0;
        }

        .li1 {
            list-style: none;
            height: 35px;
            margin-left: 5px;
            margin-right: 5px;
            line-height: 35px;
            border-bottom: 1px #FFE2E2 solid;
        }

        .li1 a {
            text-decoration: none;
        }

        .span1 {
            color: #F5F695;
            position: absolute;
            right: 18px;
        }

        ul {
            float: left;
        }

        li {
            list-style: none;
        }

        .weibu div ul {
            margin-left: 160px;
        }
        * {
            margin: 0 auto;
            padding: 0;
        }
        #ul1 li{
            list-style: none;
            float: left;
            margin-left: 26px;
            color: #FFFFFF;
            font-size: 13px;
        }
        #ul1 li a{
            color: #ffffff;
            text-decoration: none;
        }
        #ul1 li a:hover{
            color: #FFFF00;
        }
    </style>
    <script type="text/javascript">
        const BTN1 = document.getElementById('btn1');
        const BTN2 = document.getElementById('btn2');
        //给按钮2添加点击事件
        BTN2.addEventListener('click', () => {
            BTN1.onclick(); //按钮2点击后触发按钮1的onclick
            //BTN1.click(); //按钮2点击后触发按钮1的click 效果一样
        });
    </script>
</head>

<body>
<div>
    <%--第一部分--%>
    <div style="width: 100%;height: 34px;background-color: #efefef">
        <div style="text-align:right;font-size: 14px;line-height: 34px;width: 1000px;padding-right: 20px">
            官方网站<a href="https://www.gec.com">https://www.gec.com</a>
            [<a href="http://localhost:8080/${pageContext.request.contextPath}/login.jsp">${user.name}</a>]

            [<a href="http://localhost:8080/${pageContext.request.contextPath}/informationListServlet">我的购物车</a>]
            [<a href="${pageContext.request.contextPath}/orderForm.jsp">我的订单</a>]
            <a href="#">设置为首页</a>
            |<a href="#">加入收藏</a>
        </div>
    </div>

    <%--第二部分--%>
    <div>
        <div style="width: 1000px;margin-top: 20px">
            <table>
                <tr>
                    <td><img src="img/article/logo.gif"></td>
                    <td><img src="img/banner.gif"></td>
                    <td><a href="#" style="border:1px solid #CCCCCC;text-decoration: none;color: #CCCCCC;font-size: 12px">&nbsp;&nbsp;关于我们&nbsp;&nbsp;</a><br><br><a href="#" style="border:1px solid #CCCCCC;text-decoration: none;color: #CCCCCC;font-size: 12px">&nbsp;&nbsp;联系方式&nbsp;&nbsp;</a></td>
                </tr>
            </table>
        </div>
    </div>

    <%--第三部分--%>
    <div style="width: 100%;height: 30px;background-color: #CC3333;margin-top: 20px">
        <div style="width: 1000px;line-height: 30px;text-align: center">
            <ul id="ul1">
                <li><a href="index.do"target="_blank">首页</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0001">护肤</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0002">彩妆</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0003">香氛</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0004">身体护理</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0005">礼盒套装</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0006">母婴专区</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0007">男士专区</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0008">粉底</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0009">粉饼</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0010">睫毛膏</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0011">唇彩</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0012">腮红</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0013">食品保健</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0014">瘦身类</a></li>
                <li><a href="http://localhost:8080/${pageContext.request.contextPath}/index.do?type_code=0015">美容类</a></li>
            </ul>
        </div>
    </div>
</div>


<div style="background-color:#AACDED; height: 780px; margin-top: 20px; width: 850px;position: relative;">
        <p>填写核对地址</p>
        <div style="position: absolute;top: 30px;left: 23px;">
            <table width="800px" align="center" bgcolor="#f2f2f2" height="300px">
                <tr>
                    <td>
                        收货人信息
                    </td>
                </tr>
                <tr>

                    <td>
                        *收货人姓名：
                    </td>
                    <td>
                        <input type="text" size="25" name="1" placeholder="请输入名字" maxlength="6">
                    </td>
                </tr>
                <tr>
                    <td>
                        *地址：
                    </td>
                    <td>
                        <input type="text" name="2" placeholder="请输入地址">
                    </td>
                </tr>
                <tr>
                    <td>
                        *电话号码：
                    </td>
                    <td>
                        <input type="password" name="3" size="35" maxlength="12" placeholder="请输入电话">
                        用于接收发货通知短信及送货前确认
                    </td>
                </tr>
                <tr>
                    <td>
                        *电子邮件：
                    </td>
                    <td>
                        <input type="password" name="4" size="35" maxlength="12" placeholder="请输入邮件地址">
                        用来接收订单提醒邮件，便于你及时了解订单转态
                    </td>
                </tr>
                <tr>
                    <td>
                        *邮政编码：
                    </td>
                    <td>
                        <input type="text" name="5">有助于快速确定送货地址
                    </td>
                </tr>
                <tr>
                    <td>
                        <a href="#">【 选中常用地址】</a>
                    </td>

                </tr>

                <tr>

                    <td>
                        <input type="submit" name="11" value="保存收货人信息">
                    </td>

                </tr>
            </table>


            <div style="width: 800px;background-color: white;font-size: 13px;">
                <p>支付及配送方式</p>
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;支付方式：在线支付</p>
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;配送方式：快递运输</p>
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;运费：0.00元<span style="color: red;">(免运费)</span>
                </p>
                <br>
                <p>商品清单 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">返回修改购物车</a></p>
            </div>

            <div>
                <div style="width: 800px; height: 50px; background-color: #FFF4D7;">
                    <table style="width:800px">
                        <tr style="line-height: 50px;">
                            <td>
                                商品名称
                            </td>
                            <td>
                                疯狂价
                            </td>
                            <td>
                                返现

                            </td>
                            <td>
                                小计（元）
                            </td>
                            <td>
                                库存
                            </td>
                            <td>
                                数量
                            </td>
                        </tr>


                    </table>
                </div>

                <form action="" method="post">
                <div style="width: 800px; background-color: white;">

                    <table style="width:800px">
                        <c:set value="0" var="priceSum"/>
                        <c:forEach items="${informations}" var="information" varStatus="s">

                                <!--  隐藏域 提交-->
                                <c:set value="00020001" var="typeCode"/>
                                <input type="hidden" name="DISCOUNT" value="${information.DISCOUNT}">
                                <input type="hidden" name="TITLE" value="${information.TITLE}">
                                <input type="hidden" name="PRICE" value="${information.PRICE}">
                                <input type="hidden" name="supplier" value="${information.supplier}">
                                <input type="hidden" name="IMAGE" value="${information.IMAGE}">
                                <input type="hidden" name="BUYNUM" value="${information.BUYNUM}">
                                <input type="hidden" name="TYPECODE" value="${typeCode}">

                            <%--价格求和--%>
                            <c:set value="${priceSum+information.PRICE}" var="priceSum" />

                            <tr style="line-height: 50px;border-bottom: black 1px solid">
                                <td style="width: 180px; line-height:16px;font-size: 13px;">
                                   ${information.TITLE}
                                </td>
                                <td style="line-height:16px;width: 120px;">
                                        ${String.format("%.2f",information.DISCOUNT*information.PRICE)}(0.7折)
                                </td>
                                <td style="line-height:16px; width: 90px;">
                                    ￥0.00
                                </td>
                                <td style="line-height:16px; width: 220px;">
                                        ${String.format("%.2f",information.DISCOUNT*information.PRICE*information.BUYNUM)}
                                </td>
                                <td style="line-height:16px;width: 100px;">
                                    100
                                </td>
                                <td>
                                    ${information.BUYNUM}
                                </td>
                            </tr>
                        </c:forEach>

                    </table>


                </div>


                <div style="margin-top: 10px;width: 800px;height:50px;background-color: white;">
                    <p>结算信息</p>
                    <div style="width: 800px;height:65px;background-color:#FFF4D7;text-align: center;">
                        商品金额:${String.format("%.2f",priceSum)}元+运费:0.00元-优惠券:0.00元-礼品卡:0.00元-返现:0.00元
                        <hr style="margin-top: 5px;">
                        <p style="color: black;float: right">应付总额: <span style="color: red">￥${String.format("%.2f",priceSum)}</span>元</p>
                    </div>

                        <a href="${pageContext.request.contextPath}/orderForm.jsp"><img src="img/submit.jpg" style="margin-left: 600px"></a>

                    <br><br>
                </div>
                </form>
            </div>
        </div>

    </div>


</body>